<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Register</title>
    <link href="/css/bootstrap.css", rel="stylesheet">
    <script src="/js/jquery-3.6.4.js"></script>
    <script src="/js/bootstrap.js"></script>
</head>
<body>
<form>
    <div class="mb-3">
        <label for="inputUsername" class="form-label">用户名</label>
        <input type="text" class="form-control" id="inputUsername">
    </div>
    <div class="mb-3">
        <label for="inputPassword" class="form-label">密码</label>
        <input type="password" class="form-control" id="inputPassword">
    </div>
    <button id="registerBtn" type="button" class="btn btn-primary">注册</button>
</form>
<script>
    $('#registerBtn').click(() => {
        $.post({
            url: '/register',
            dataType: 'JSON',
            contentType: 'application/json',
            data: JSON.stringify({
                username: $('#inputUsername').val(),
                password: $('#inputPassword').val(),
            })
        })
    })

</script>
</body>
</html>